﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Syspetro.Core.SysInterface
{
    public interface ICache
    {
        T Get<T>(string key);
        string Get(string key);
        Task<T> GetAsync<T>(string key);
        T Get<T, V>(string key, V model, Func<V, T> func, TimeSpan expiry = default);
        Task<T> GetAsync<T, V>(string key, V model, Func<V, T> func, TimeSpan expiry = default);
        bool Set(string key, string data, TimeSpan expiry = default);
        Task<bool> SetAsync(string key, string data, TimeSpan expiry = default);
        bool Remove(string key);
    }
}
